﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using VideoCall.DataSetLocalTableAdapters;
namespace VideoCall
{
    
    class DataProvider
    {
        DataSetLocal dataSet = new DataSetLocal();
        private DataTableAdapter dataTableAdater = new DataTableAdapter();
        private void GetData()
        {
            dataTableAdater.Fill(dataSet.Data);
        }
        public void UpdataIPServer(string ip)
        {
            GetData();
            dataSet.Data.Single(p => p.ID == 1).IpServer = ip;
            dataTableAdater.Update(dataSet.Data);
        }
        public void UpdataAvarta(string avarta)
        {
            GetData();
            dataSet.Data.Single(p => p.ID == 1).Avarta = avarta;
            dataTableAdater.Update(dataSet.Data);
        }
        public string GetAvatar()
        {
            GetData();
            return dataSet.Data.Single(p => p.ID == 1).Avarta;
        }
        public string GetIPServer()
        {
            GetData();
            return dataSet.Data.Single(p => p.ID == 1).IpServer;
        }

    }
}
